package com.dkx.wm;

import com.dkx.wm.entity.User;
import com.dkx.wm.service.UserService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;

public class test {

    @Autowired
    private UserService userService;
    //PageHelper
    @Test
    public void test1(){
        PageHelper.startPage(1, 3);
        List<User> roles = userService.getAllUsers();
        System.out.println(roles);
        PageInfo<User> pageInfo = new PageInfo<>(roles);
        System.out.println(pageInfo.getNextPage());  //下一页
        System.out.println(pageInfo.getPrePage());  //上一页
        System.out.println(pageInfo.getPageNum());  //当前页
        System.out.println(pageInfo.getPageSize());  //每页多少条
        System.out.println(pageInfo.getSize());  //当前页的条数
        System.out.println(pageInfo.getTotal());  //总条数
        System.out.println(pageInfo.getPages());  //总页数
    }
}
